# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=undock
pkgver=0.3.0
pkgrel=0
pkgdesc="A tool to extract contents of a container image into a local folder"
url="https://crazymax.dev/undock/"
arch="all"
license="MIT"
makedepends="go linux-headers gpgme-dev btrfs-progs-dev lvm2-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/crazy-max/undock/archive/refs/tags/v$pkgver.tar.gz"

build() {
	export _gotags="containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
	go build -v -o bin/$pkgname \
		-ldflags "-X main.version=$pkgver" \
		-tags "$_gotags" \
		./cmd
}

check() {
	go test -tags "$_gotags" ./...
}

package() {
	install -Dm755 bin/$pkgname -t "$pkgdir"/usr/bin
}

sha512sums="
4dd5403c3a95c0896ea95f7eb7ae1f3689ed1ff3ae2bcdcc766513f9f6b5d4d75b95c33c9815edfd37f7f6d603dd8fc837e1f4887411b36768bf74bf45601e2f  undock-0.3.0.tar.gz
"
